#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    bool isUnique(string astr) {
        if (astr.size() > 26) return false;
        int ret = 0;
        for (auto e : astr)
        {
            if (((ret >> (e - 'a')) & 1) == 0)
                ret |= (1 << (e - 'a'));
            else
                return false;
        }
        return true;
    }
};